package GUI.MarketingEmployee;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;

import Entity.User;
import GUI.ManagerEmployee.AddSaleTemplatePnl;
import GUI.ManagerEmployee.DefaultPanel;
import GUI.ManagerEmployee.GetSaleOperationPnl;
import GUI.ManagerEmployee.ManagerEmployeeGUI;
import GUI.ManagerEmployee.NewSalePnl;
import GUI.ManagerEmployee.ReportsPanel;
import GUI.ManagerEmployee.analyticalSystemPnl;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import java.awt.Color;
import java.io.IOException;

public class MarketingEmployeeGUI extends JFrame {

	private JPanel contentPane;
	MarketingEmployeeGUI frame ;
	JPanel centerPanel;
	public AddCustomerPnl AddCustomerPnl ;
	public AddProductPnl addProductPnl;
	public MEDefaultPanel meDefaultPanel;
	public AddContactCustomerPnl addContactCustomerPnl;
	public analyticalSystemPnl analyticalSystemPnl;


	public MarketingEmployeeGUI() {
		centerPanel = new JPanel();
		AddCustomerPnl  = new AddCustomerPnl();
		addProductPnl = new AddProductPnl();
		meDefaultPanel = new MEDefaultPanel();
		addContactCustomerPnl  = new AddContactCustomerPnl ();
		 

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 840, 544);
		contentPane = new JPanel();
		
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
  // ------------------  Add Client ----------------	
	
		JButton btnAddCustomer = new JButton("Add Customer");
		
		btnAddCustomer.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
				 
				contentPane.remove(centerPanel);
				centerPanel = AddCustomerPnl ;
				centerPanel .setBounds(171, 11, 619, 451);
				contentPane.add(centerPanel );
				
                repaint();
                	
			}
		});
	
		btnAddCustomer.setBounds(10, 122, 175, 36);
		contentPane.add(btnAddCustomer);

		// ------------------  Add Product  ----------------
		
		JButton btnAddProduct = new JButton("Add Product");
		btnAddProduct.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				 
				contentPane.remove(centerPanel);
				centerPanel = addProductPnl;
				centerPanel .setBounds(171, 11, 619, 451);
				contentPane.add(centerPanel );
				
                repaint();
				
			}
		});
		btnAddProduct.setBounds(10, 75, 175, 36);
		contentPane.add(btnAddProduct);
		
		// ------------------  Home ----------------	
		
		JButton btnHome = new JButton("Home");
		btnHome.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			
				contentPane.remove(centerPanel);
				centerPanel = meDefaultPanel;
				centerPanel .setBounds(171, 11, 619, 451);
				contentPane.add(centerPanel );
				
                repaint();
				
			}
		});
		btnHome.setBounds(10, 28, 175, 36);
		contentPane.add(btnHome);
		
		// ------------------  Add Contact Client ------------------
				JButton btnAddContactCustomer = new JButton("Add Contact Customer");
				btnAddContactCustomer.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						
						contentPane.remove(centerPanel);
						centerPanel = addContactCustomerPnl  ;
						centerPanel .setBounds(171, 11, 619, 451);
						contentPane.add(centerPanel );
						
		                repaint();
					}
				});
				
				btnAddContactCustomer.setBounds(10, 169, 175, 36);
				contentPane.add(btnAddContactCustomer);
		
	//------------------------------------------------------------------	
		
		centerPanel.setBounds(195, 11, 619, 451);
		contentPane.add(centerPanel);
		

	// ------------------  Exit ------------------		
		JButton btnExit = new JButton("exit");
		btnExit.setBounds(10, 383, 151, 36);
		contentPane.add(btnExit);
		
		JButton btnSynchronizData = new JButton("Synchronize Data");
		btnSynchronizData.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				contentPane.remove(centerPanel);
				centerPanel = analyticalSystemPnl;
				centerPanel .setBounds(171, 11, 619, 451);
				contentPane.add(centerPanel );
				
                repaint();
			}
		});
		btnSynchronizData.setBounds(10, 216, 175, 36);
		contentPane.add(btnSynchronizData);
		
		setVisible(true);
	}
	
}
